package config

import (
	"fmt"
)

type RedisConf struct {
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	DB       int    `mapstructure:"db"`
	User     string `mapstructure:"user"`
	Password string `mapstructure:"password"`
	PoolSize int    `mapstructure:"pool_size"`
}

func (conf RedisConf) Addr() string {
	return fmt.Sprintf("%s:%d", conf.Host, conf.Port)
}
